<?#//v.3.1.1
#///////////////////////////////////////////////////////
#//  COPYRIGHT 2004 Phpauction.org ALL RIGHTS RESERVED//
#///////////////////////////////////////////////////////

require('../includes/config.inc.php');
include "loggedin.inc.php";
include $include_path.'dates.inc.php';

#//Default for error message (blank)
$ERR = "&nbsp;";

#// Insert new currency
if($_POST['action'] == "delete" && phpa_securepost($_POST)) {
	$query = "DELETE FROM PHPAUCTIONXL_comm_messages
				  WHERE id=$_POST[msg]";
	$res = @mysql_query($query);
	//print $query;
	if(!$res) {
		print "Error: $query<BR>".mysql_error();
		exit;
	} else {
		#// Update messages counter
		$query = "UPDATE PHPAUCTIONXL_community SET messages=messages-1 WHERE id=".$_POST['id'];
		$res_ = @mysql_query($query);
		if(!$res_) {
			print "Error: $query<BR>".mysql_error();
			exit;
		}
		Header("Location: editmessages.php?id=".$_POST['id']);
		exit;
	}
} else {
	#// Retrieve message from the database
	$query = "SELECT * FROM PHPAUCTIONXL_comm_messages WHERE id=".$_GET['msg'];
	$res_ = @mysql_query($query);
	if(!$res_) {
		print "Error: $query<BR>".mysql_error();
		exit;
	} else {
		$MSG = mysql_fetch_array($res_);
	}
}

?>
<HTML>
<HEAD>
<link rel='stylesheet' type='text/css' href='style.css' />
<STYLE TYPE="text/css">
body {
scrollbar-face-color: #aaaaaa;
scrollbar-shadow-color: #666666;
scrollbar-highlight-color: #aaaaaa;
scrollbar-3dlight-color: #dddddd;
scrollbar-darkshadow-color: #444444;
scrollbar-track-color: #cccccc;
scrollbar-arrow-color: #ffffff;
}</STYLE>
<link href="css/main.css" rel="stylesheet" type="text/css">
</HEAD>
<body bgcolor="#FFFFFF" text="#000000" link="#0066FF" vlink="#666666" alink="#000066" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="titulo">
        <tr> 
          <td class="icono"><img src="images/content_icon.gif" width="28" height="27" ></td>
          <td class="breadcrumbs"><p><span><?=$MSG_25_0018?></span>&nbsp;&gt;&gt;&nbsp;<?=$MSG_5032?></p></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td align="center" valign="middle">&nbsp;</td>
  </tr>
    <tr> 
    <td align="center" valign="middle"> 
	<FORM NAME="deletemessage" METHOD="post" ACTION="<?=basename($_SERVER['PHP_SELF'])?>">
	<TABLE WIDTH="95%" BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="CENTER">
		<TR>
			<TD>
				<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="CENTER" class="base" style="border:1px solid #ccc;">
					<TR>
						<TD COLSPAN="2" align=center class=title>
								<p><?=$MSG_5276?></p>
						</TD>
					</TR>
					<TR BGCOLOR="#FFFFFF">
						<TD WIDTH="24%" VALIGN="TOP">
							<p class="blue"><?=$MSG_333?></p>
						</TD>
						<TD WIDTH="76%" VALIGN="TOP">
						<p><?=nl2br($MSG[message])?></p></TD>
					</TR>
					<TR >
						<TD WIDTH="24%" class="gris"><p class="blue"><?=$MSG_5060?></p></TD>
						<TD WIDTH="76%" class="gris">
							<p><?
							if($MSG[user] > 0) {
								print $MSG[username];
							} else {
								print $MSG_5061;
							}
							?>
							-
							<?=FormatDate($MSG[msgdate])?></p>
						</TD>
					</TR>
					<TR BGCOLOR="#FFFFFF">
						<TD WIDTH="24%">
							<INPUT TYPE="hidden" NAME="action" VALUE="delete">
							<INPUT TYPE="hidden" NAME="security" VALUE="<?php echo $_SESSION['security'];?>" />
							<INPUT TYPE="hidden" NAME="id" VALUE="<?=$_REQUEST['id']?>">
							<INPUT TYPE="hidden" NAME="msg" VALUE="<?=$_REQUEST['msg']?>">
						</TD>
						<TD WIDTH="76%">
							<INPUT TYPE="submit" NAME="Submit" VALUE="<?=$MSG_5276?>" class="action">
						</TD>
					</TR>
				</TABLE>
			</TD>
		</TR>
	</TABLE>
</FORM>
</td></tr></table>
</BODY>
</HTML>